package com.knowledge.graph.exception;

import com.knowledge.graph.model.vo.ResponseVO;
import com.knowledge.graph.model.vo.StatusCode;
import org.apache.tomcat.util.http.fileupload.impl.FileSizeLimitExceededException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class GlobalExceptionHandler {

    @ExceptionHandler(value = FileSizeLimitExceededException.class)
    public ResponseVO exceptionHandler(FileSizeLimitExceededException e) {
        return new ResponseVO(StatusCode.FAIL_VIDEO_SIZE.getCode(), StatusCode.FAIL_VIDEO_SIZE.getMessage());
    }
}
